Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature improve weather #244

Merged
merged 7 commits into from
Dec 4, 2023
Merged

Conversation

dschlaep
Copy link
Member

@dschlaep dschlaep commented Dec 1, 2023

  • functionality to impute and 'fix' weather
  • functionality to download weather and format for rSOILWAT2

- `dbW_weatherData_round()` now rounds both "weatherList" and "weather data frame" objects; argument "digits" can now also be logical (if TRUE, then digits takes the default value of 4) or not finite (e.g., NA; not finite values return the input without rounding).
- argument "round" of `dbW_dataframe_to_weatherData()` is deprecated and changed the default value from rounding to 2 digits to no rounding (NA) - recommended replacement is a separate call to `dbW_weatherData_round()`.
- argument "digits" of `dbW_generateWeather()` changed the default value from rounding to 4 digits to no rounding (NA)
- `dbW_generateWeather()` gained `"return_weatherDF"` and now returns a user requested weather object type.
If `return_weatherDF` is `TRUE`, then the result is converted to a data frame where columns represent weather variables; otherwise, a list of elements of class `swWeatherData` is returned (as previously).
- `dbW_imputeWeather()` combines the use of the weather generator and `rSW2utils::impute_df()` for replacing missing weather values

- `dbW_imputeWeather()` simplifies the weather section of the demo vignette substantially
`dbW_substituteWeather()` replaces missing weather values in one weather data object with values from a second weather data object
…of approaches

Approaches are linear interpolation for short missing spells, possibly fixed values for short missing precipitation spells, substitution from a second weather data object, and finally replacement with long term daily mean values
New family of functions `sw_meteo_obtain` that obtain (download) weather data from external sources and prepare for use by `"rSOILWAT2"`
* `sw_meteo_obtain_DayMet()` obtains and formats data from `"Daymet"`
* `sw_meteo_obtain_SCAN()` obtains and formats data from `"SCAN"`

- vignette "demo" is simplified thanks to `sw_meteo_obtain_DayMet()`
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Attention: 144 lines in your changes are missing coverage. Please review.

Comparison is base (04870d4) 58.99% compared to head (e0017bc) 58.93%.

Files Patch % Lines
R/sw_WeatherExtract.R 0.00% 111 Missing ⚠️
R/swWeatherGenerator.R 89.16% 22 Missing ⚠️
R/sw_dbW_WeatherDatabase.R 54.54% 10 Missing ⚠️
R/D_swWeatherData.R 90.00% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           release/devel_v6.0.4     #244      +/-   ##
========================================================
- Coverage                 58.99%   58.93%   -0.07%     
========================================================
  Files                        42       43       +1     
  Lines                      8263     8593     +330     
========================================================
+ Hits                       4875     5064     +189     
- Misses                     3388     3529     +141     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dschlaep dschlaep merged commit 72d4bf2 into release/devel_v6.0.4 Dec 4, 2023
7 of 9 checks passed
@dschlaep dschlaep deleted the feature_improveWeather branch December 4, 2023 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant